// maphousekey.sqf 9/5/13
// Updated to use arrays for multiple member access to houses/compounds.
// When you alter _MARKERS ensure you edit burgler.sqf

_house  = ((_this select 3) select 0);
_housename = ((_this select 3) select 1);
_uid = getPlayerUID vehicle player;

_unit = _this;
_dist = 150;
_marker = "";
{_range = ((getMarkerPos _x) distance (player));
if (_range < _dist) then 
{_dist = _range; _marker = _x};	
} foreach Homearray;

// Add Member sections here
// +Example:
// _nameofgangUIDs = ["12345","67890"]; // Add as many members as you want separated by commas.
//
//_aftermathUIDs = ["3343430","47693382"]; // Aftermath + Cpt Austin. (For Test)

_blackwolfUIDs = ["113830662"];
_cheliosUIDs = ["113830662"];
_garrettUIDs = ["98845894"];
_bellplantationUIDs = ["88623302","79829446","79830982","75218374"];
_demonhunterUIDs = ["96986118","109288646"];
_cartelcmpdUIDs = [""];
_hillsidevillaUIDs = [""];
_stanleyUIDs = ["127907270"];
_legacyUIDs = [""];
_markUIDs = ["96551366"];
_lunaUIDs = ["69436870"];
_janjkoUIDs = ["48016902"];
_janjko2UIDs = ["48016902"];
_talstanUIDs = ["127071430","127907270"];
_hostageUIDs = ["139836742"];
_fugitiveUIDs = ["120936326"];
_jebusUIDs = ["149141382"];

// Add Gang recognition here.
// +Example:
// case (_marker == "markerNAME"):{if(_uid in _nameofgangUIDs) then {[_house,_housename] execVM "maphouse.sqf";} else {player groupchat "This is not owned by you!";};};
// markerNAME should equal the physical name of Marker on the map which should be placed on the house desired.
// _nameofgangUIDs (can just be a single person) should be whatever Array was created for that gangs house/compound.
//

switch true do
{
//case (_marker == "aftermath"):{if(_uid in _aftermathUIDs) then {[_house,_housename] execVM "maphouse.sqf";} else {player groupchat "This shit aint working.";};}; // For Test

case (_marker == "blackwolf"):{if(_uid in _blackwolfUIDs) then {[_house,_housename] execVM "maphouse.sqf";} else {player groupchat "This is not owned by you";};};
case (_marker == "chelios"):{if(_uid in _cheliosUIDs) then {[_house,_housename] execVM "maphouse.sqf";} else {player groupchat "This is not owned by you";};};
case (_marker == "garrett"):{if(_uid in _garrettUIDs) then {[_house,_housename] execVM "maphouse.sqf";} else {player groupchat "This is not owned by you";};};
case (_marker == "bell_plantation"):{if(_uid in _bellplantationUIDs) then {[_house,_housename] execVM "maphouse.sqf";} else {player groupchat "This is not owned by you";};};
case (_marker == "DemonHunter"):{if(_uid in _demonhunterUIDs) then {[_house,_housename] execVM "maphouse.sqf";} else {player groupchat "This is not owned by you";};};
case (_marker == "cartel_compound"):{if(_uid in _cartelcmpdUIDs) then {[_house,_housename] execVM "maphouse.sqf";} else {player groupchat "This is not owned by you";};};
case (_marker == "hillside_villa"):{if(_uid in _hillsidevillaUIDs) then {[_house,_housename] execVM "maphouse.sqf";} else {player groupchat "This is not owned by you";};};
case (_marker == "cidos"):{if(_uid in _cidosUIDs) then {[_house,_housename] execVM "maphouse.sqf";} else {player groupchat "This is not owned by you";};};
case (_marker == "Legacy"):{if(_uid in _legacyUIDs) then {[_house,_housename] execVM "maphouse.sqf";} else {player groupchat "This is not owned by you";};};
case (_marker == "jacko1"):{if(_uid in _markUIDs) then {[_house,_housename] execVM "maphouse.sqf";} else {player groupchat "This is not owned by you";};};
case (_marker == "jacko2"):{if(_uid in _lunaUIDs) then {[_house,_housename] execVM "maphouse.sqf";} else {player groupchat "This is not owned by you";};};
case (_marker == "HellDriven"):{if(_uid in _janjkoUIDs) then {[_house,_housename] execVM "maphouse.sqf";} else {player groupchat "This is not owned by you";};};
case (_marker == "HellDriven_1"):{if(_uid in _janjko2UIDs) then {[_house,_housename] execVM "maphouse.sqf";} else {player groupchat "This is not owned by you";};};
case (_marker == "RevoMods"):{if(_uid in _talstanUIDs) then {[_house,_housename] execVM "maphouse.sqf";} else {player groupchat "This is not owned by you";};};
case (_marker == "stanley"):{if(_uid in _stanleyUIDs) then {[_house,_housename] execVM "maphouse.sqf";} else {player groupchat "This is not owned by you";};};
case (_marker == "hostagecompound"):{if(_uid == _hostageUIDs) then {[_house,_housename] execVM "maphouse.sqf";} else {player groupchat "This is not owned by you";};};
case (_marker == "FugitiveCompound"):{if(_uid == _fugitiveUIDs) then {[_house,_housename] execVM "maphouse.sqf";} else {player groupchat "This is not owned by you";};};
case (_marker == "Jebus"):{if(_uid == _jebusUIDs) then {[_house,_housename] execVM "maphouse.sqf";} else {player groupchat "This is not owned by you";};};

//case (_marker == ""):{if(_uid == "") then {[_house,_housename] execVM "maphouse.sqf";} else {player groupchat "This is not owned by you";};};
default {[_house,_housename] execVM "maphouse.sqf";};
};
